473,469 Members | 1,612 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Retaining form values inside the display of select pulldown boxes

I have a select-pulldown at http://computergroupplays.com/fb-pres2.asp
that changes the 3rd pulldown (Dbase) depending on what the user
enters in the 2nd (Wk). My associate wants the values inside the
select box to retain their values after hitting the Go-Submit button
when selecting the 3 choices- they want to see the values retained on
the next page when you look at the form. Below is the include file
used to generate the dynamic pulldown value for the 3rd pulldown:

<script language="Javascript">

var arrayData = new Array();

arrayData[0] = '1|LY-YrToDate|'
arrayData[1] = '1|LY-Last8wk|'
arrayData[2] = '2|LY-YrToDate|'
arrayData[3] = '2|LY-Last8wk|'
arrayData[4] = '3|Avg(YrTD-LY)|'
arrayData[5] = '4|YrToDate|'
arrayData[6] = '5|YrToDate|'
arrayData[7] = '6|YrToDate|'
arrayData[8] = '7|YrToDate|'
arrayData[9] = '8|YrToDate|'
arrayData[10] = '8|Rolling-6wk|'
arrayData[11] = '9|YrToDate|'

function populateData( name ) {

select = window.document.form.DBCode;
string = "";

// 0 - will display the new options only
// 1 - will display the first existing option plus the new options

count = 0;

// Clear the old list (above element 0)

select.options.length = count;

// Place all matching categories into Options.

for( i = 0; i < arrayData.length; i++ ) {
string = arrayData[i].split( "|" );
if( string[0] == name ) {
select.options[count++] = new Option( string[1] );
}
}
}

</script>

===
.....and the html in the form:
<form name="form" method="post" action="fb-query-post6.asp">
<td height="114" valign="top"
background="images/wayback.jpg" width="359"><p><br>
&nbsp;&nbsp;<br>
&nbsp;</p>
<p> &nbsp;<font color="#FF9900" size="2">Yr</font>
<select name="season" STYLE="font-family : monospace;
font-size : 7.5pt"><option></option>
<option value="2003">2003</option>
<option value="2002">2002</option>
<option value="2001">2001</option>
</select>
<font color="#FF9900" size="2">Wk#</font>
<select name="gameweek" size=1 STYLE="font-family :
monospace;
font-size : 7.5pt"
onChange='javascript:populateData(
this.options[selectedIndex].text )'>
<option></option>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
<option value="6">6</option>
<option value="7">7</option>
<option value="8">8</option>

</select>
&nbsp; <font color="#FF9900" size="2">DBase
<select name="DBCode" STYLE="font-family : monospace;
font-size : 7.5pt">
</select>
&nbsp;<input name="submit" type="submit" class="inputSubmit"
value="Go" size="8" align="absbottom">
</form>

using option value "selected" gives this scenario problems. Any remedy
into what I'm suggesting, or is it possible?

thx
Cgplays.com
Jul 20 '05 #1
1 6605
> I have a select-pulldown at http://computergroupplays.com/fb-pres2.asp
that changes the 3rd pulldown (Dbase) depending on what the user
enters in the 2nd (Wk). My associate wants the values inside the
select box to retain their values after hitting the Go-Submit button
when selecting the 3 choices- they want to see the values retained on
the next page when you look at the form. Below is the include file
used to generate the dynamic pulldown value for the 3rd pulldown:


Perhaps I missed something you asked but in case I didn't:
You have a function that changes the value of Dbase when Wk selected.
Pass the value of Wk to the 'next page.'
Include the function (that changes Dbase) in the 'next page' and run
it when the page opens. It will then set Dbase on the 'next page' the
same way it did on the first page because you are passing it the same
value you did the first time.
HTH
Pachydermitis
Jul 20 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Mark R | last post by:
I have one .asp page with a SELECT pulldown list on it and some INPUT fields. When SUBMIT is clicked the form data is submitted to that same page and validated. If INPUT fields are empty the asp...
1
by: J. Muenchbourg | last post by:
I have 3 select pulldown boxes where a user will select a year (either 2002 or 2001), a week (one thru 52), and a database (short data or long data). But if a user selects a week that is less than...
1
by: Scott Medaugh | last post by:
Hello, I am trying to do something unusual and it has me stumped. I am looking to change the Env variable for RemoteUser essentially. What I would like to happen is that the user would choose...
2
by: Sean | last post by:
Greetings all, I am attempting to make a form that will filter through several tables that (I believe) have refretial integrity. I am pulling data from several tables into the form and i would...
0
by: loga123 | last post by:
Hi All, I am very new to .net and trying to develop a small application. I am using asp .net 2.0. I have a table control (server) in my code that has header row like this. <asp:Table...
2
by: assgar | last post by:
Hi Developemnt on win2003 server. Final server will be linux Apache,Mysql and PHP is being used. I use 2 scripts(form and process). The form displays multiple dynamic rows with chechboxs,...
18
ak1dnar
by: ak1dnar | last post by:
Hi, I have created a web application that enables to Delete Items in a product table using check boxes. I Need to Display each and every product in <TR> and with the product there is a corresponding...
3
by: =?Utf-8?B?ZGVuIDIwMDU=?= | last post by:
Hi, Trouble in retaining values of dropdownlist, textboxes, and other controls when dropdownlist selectedindexchanged event is triggered, the controls are inside a user control and this user...
2
by: anusha.vempati9 | last post by:
Hi All, I am calling a cgi file from a perl module. The cgi file contains the HTML form and some HTML fields(like check boxes). In my logic, I am trying to submit the form and calling the same...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.